home *** CD-ROM | disk | FTP | other *** search
- class classes.shots.DeathBall
- {
- var x;
- var y;
- var id;
- var clip;
- var cv;
- var trans;
- var colorTrans;
- var xMov = 0;
- var yMov = 0;
- var xMovT = 0;
- var yMovT = 0;
- var c = 0;
- var power = 30;
- var Name = "deathBall";
- function DeathBall(px, py, pxMov, pyMov, pid)
- {
- this.x = px;
- this.y = py;
- this.id = pid;
- this.xMov = pxMov;
- this.yMov = pyMov;
- _root.d = _root.d + 1;
- this.clip = _root.attachMovie("deathBall","deathBall" + this.id + "Clip",_root.d);
- this.clip._x = this.x;
- this.clip._y = this.y;
- this.cv = 0.5;
- this.xMov *= _root.dif.speed;
- this.yMov *= _root.dif.speed;
- var _loc5_ = _root.randRange(-10,10);
- var _loc4_ = _root.randRange(-75,75);
- var _loc3_ = _root.randRange(-20,20);
- this.trans = new flash.geom.Transform(this.clip);
- this.colorTrans = new flash.geom.ColorTransform(1,1,1,1,_loc5_,_loc4_,_loc3_,0);
- this.trans.colorTransform = this.colorTrans;
- }
- function main()
- {
- this.c = this.c + 1;
- this.clip.fizzle1._x = _root.randRange(1,5) * 3;
- this.clip.fizzle1._y = _root.randRange(1,5) * 3;
- this.clip.fizzle1._alpha = _root.randRange(5,40);
- this.clip.fizzle2._x = _root.randRange(1,5) * 3;
- this.clip.fizzle2._y = _root.randRange(1,5) * 3;
- this.clip.fizzle2._alpha = _root.randRange(5,40);
- this.clip.fizzle3._x = _root.randRange(1,5) * 3;
- this.clip.fizzle3._y = _root.randRange(1,5) * 3;
- this.clip.fizzle3._alpha = _root.randRange(5,40);
- this.clip.fizzle4._x = _root.randRange(1,5) * 3;
- this.clip.fizzle4._y = _root.randRange(1,5) * 3;
- this.clip.fizzle4._alpha = _root.randRange(5,40);
- this.clip.fizzle5._x = _root.randRange(1,5) * 3;
- this.clip.fizzle5._y = _root.randRange(1,5) * 3;
- this.clip.fizzle5._alpha = _root.randRange(5,40);
- if(this.c < 30)
- {
- this.xMovT *= 0.9;
- this.yMovT *= 0.9;
- }
- else if(this.c == 30)
- {
- var _loc3_ = _root.getAngleRad(this.x,this.y);
- this.xMovT = Math.cos(_loc3_) * _root.randRange2(4,7);
- this.yMovT = Math.sin(_loc3_) * _root.randRange2(4,7);
- }
- else
- {
- this.xMovT *= 1.1;
- this.yMovT *= 1.1;
- }
- if(this.clip.hitTest(_root[_root.char + "Clip"]))
- {
- _root[_root.char].hit(this.xMov,this.yMov,100,this.power);
- }
- if(this.x > 1050 || this.x < -50 || this.y > 650 || this.y < -50)
- {
- _root.removeEnemyShot("deathBall" + this.id);
- }
- if(this.xMovT < this.xMov)
- {
- this.xMov -= this.cv;
- }
- else if(this.xMovT > this.xMov)
- {
- this.xMov += this.cv;
- }
- else
- {
- this.xMov = this.xMovT;
- }
- if(this.yMovT < this.yMov)
- {
- this.yMov -= this.cv;
- }
- else if(this.yMovT > this.yMov)
- {
- this.yMov += this.cv;
- }
- else
- {
- this.yMov = this.yMovT;
- }
- this.x += this.xMov;
- this.y += this.yMov;
- this.clip._x = this.x;
- this.clip._y = this.y;
- }
- }
-